<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

class Template {

    var $template_data = array();

    function set($name, $value) {
        $this->template_data[$name] = $value;
    }

    function load($template = '', $view = '', $view_data = array(), $theme = '', $return = FALSE) {
        $this->CI = & get_instance();
        if (empty($theme)) {
            $this->CI->config->load('config');
            $theme = $this->CI->config->item('theme');
        }
        $this->set('contents', $this->CI->load->view($theme . '/' . $view, $view_data, TRUE));
        return $this->CI->load->view($theme . '/' . $template, $this->template_data, $return);
    }

}

/* End of file Template.php */
/* Location: ./system/application/libraries/Template.php */